package com.example.baselibrary.db.table;

import android.text.TextUtils;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

/**
 * 常用联系人表
 *
 * @author Zml
 * @date 2018/3/27.
 */
@DatabaseTable(tableName = "topContacts")
public class TopContactsTable {
    @DatabaseField(columnName = "account", id = true)
    public String account;
    /**
     * 昵称
     */
    @DatabaseField(columnName = "nick")
    public String nick;
    /**
     * 头像
     */
    @DatabaseField(columnName = "avatar")
    public String avatar;
    /**
     * 企业用户id
     */
    @DatabaseField(columnName = "memberId")
    public String memberId;
    /**
     * 职位
     */
    @DatabaseField(columnName = "position")
    public String position;
    /**
     * 手机号
     */
    @DatabaseField(columnName = "mobile")
    public String mobile;
    /**
     * 当前登录的用户(用来区分添加的常用联系人归属入那个一个账号)
     */
    @DatabaseField(columnName = "userId")
    public String userId;
    /**
     * 时间戳
     */
    @DatabaseField(columnName = "timestamp")
    public Long timestamp;

    public TopContactsTable() {
    }

    public TopContactsTable(String account, String nick, String avatar, String memberId, String position, String mobile) {
        this.account = TextUtils.isEmpty(account) ? "" : account;
        this.nick = TextUtils.isEmpty(nick) ? "" : nick;
        this.avatar = TextUtils.isEmpty(avatar) ? "" : avatar;
        this.memberId = TextUtils.isEmpty(memberId) ? "" : memberId;
        this.position = TextUtils.isEmpty(position) ? "" : position;
        this.mobile = TextUtils.isEmpty(mobile) ? "" : mobile;

    }

}
